Skip to content

feat: add data sources github_actions_remove_token and github_actions_organization_remove_token #2702

Open
dankress wants to merge 15 commits into
integrations:mainfrom
dankress:github_actions_runner_removal_token
Open

feat: add data sources github_actions_remove_token and github_actions_organization_remove_token #2702
dankress wants to merge 15 commits into
integrations:mainfrom
dankress:github_actions_runner_removal_token

Conversation

@dankress
Copy link
Copy Markdown

Resolves #2696


Before the change?

  • Data source github_actions_remove_token didn't exist
  • Data Source github_actions_organization_remove_token didn't exist
  • Test for github_actions_registration_token does not work, because for new repo creation vulnerability_alerts is automatically activated, which is not reflected in tests, leading to immediate drift

After the change?

  • Data source github_actions_remove_token lets you create a self-hosted runner remove token at the repository level
  • Data source github_actions_organization_remove_token lets you create a self-hosted runner remove token at the organization level
  • Implemented tests for github_actions_remove_token and github_actions_organization_remove_token similar to tests for github_actions_registration_token and github_actions_organization_registration_token
  • Fixed test for github_actions_registration_token, by registering of test repo with activated vulnerability alerts
  • Added documentation similar to github_actions_registration_token and github_actions_organization_registration_token

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

Copy link
Copy Markdown
Collaborator

@diofeher diofeher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, @dankress!

Please review the errors from the automatic checks; some can be fixed with go fmt, and there's another issue related to the use of fmt.Errorf. I will do a second review after these are resolved.

EDIT: I'm fixing the issues myself to release this PR this week.

@github-project-automation github-project-automation Bot moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active Nov 26, 2025
@diofeher diofeher self-assigned this Dec 2, 2025
dankress and others added 13 commits December 2, 2025 07:27
Add github_actions_remove_token data source to retrieve
remove tokens for GitHub Actions runners. The data source provides
token and expiration time fields for managing runner removal operations.
…st repositories to avoid drift, as vuln alerts are automatically activated for newly created repositories
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>

Right aligning

Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>

fmt issues

Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
@diofeher diofeher force-pushed the github_actions_runner_removal_token branch from 574bdca to 25fbc95 Compare December 2, 2025 10:27
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Copy link
Copy Markdown
Collaborator

@diofeher diofeher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the convention of creating tokens in data sources (as data_source_github_actions_registration_token and data_source_github_app_token), I think it's good to have this one creating tokens as well. Another possibility would be using this one as an ephemeral resource.

@diofeher
Copy link
Copy Markdown
Collaborator

diofeher commented Dec 2, 2025

Thanks for the submission @dankress! We'll be holding this PR for the next v7 release. We will release this one as an ephemeral resource.

@diofeher diofeher modified the milestones: v6.x version wrap up, v7 Next Dec 2, 2025
@dankress
Copy link
Copy Markdown
Author

Great to see my contribution being put to use, looking forward to the release!

@deiga deiga added the Status: Blocked Some technical or requirement is blocking the issue label Apr 19, 2026
@deiga deiga removed this from the v7 Next milestone Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Blocked Some technical or requirement is blocking the issue

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[FEAT]: Data source for creating a remove token for self-hosted runners

5 participants